TreeMap

A key→value mapping where the keys are guaranteed to be sorted.

Constructors

this
this()

No default construction if an allocator must be provided.

this
this(Allocator allocator)

Use the given allocator for allocations.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

opSlice
alias opSlice = byValue

Functions

allocator
auto allocator()
Undocumented in source. Be warned that the author may not have intended to support it.
back
auto back()
byKey
auto byKey()
byKeyValue
auto byKeyValue()
byValue
auto byValue()
clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
containsKey
bool containsKey(K key)
empty
bool empty()
front
auto front()
get
auto get(K key, V defaultValue)
getOrAdd
auto getOrAdd(K key, V defaultValue)

If the given key does not exist in the TreeMap, adds it with the value defaultValue.

insert
void insert(K key, V value)

Inserts or overwrites the given key-value pair.

keys
auto keys()
length
size_t length()
opIndex
auto opIndex(K key)

Supports treeMapkey syntax.

opIndexAssign
void opIndexAssign(V value, K key)

Supports treeMapkey = value; syntax.

remove
bool remove(K key)

Removes the key→value mapping for the given key.

values
auto values()

Parameters

K

the key type

V

the value type

Allocator

the allocator to use. Defaults to Mallocator.

less

the key comparison function to use

supportGC

true to support storing GC-allocated objects, false otherwise

cacheLineSize

the size of the internal nodes in bytes

Meta